class CreateTimelineEvents < ActiveRecord::Migration
  def self.up
    create_table :timeline_events do |t|

    t.integer :memorylane_id, :null => false
	  t.datetime :event_start
	  t.datetime :latest_start
	  t.datetime :earliest_end
	  t.datetime :event_end
	  t.boolean :is_duration
	   t.string :title, :description ,:image,:link, :icon, :color ,:text_color
     t.decimal :latitude , :precision => 15, :scale => 10
     t.decimal :longtitude , :precision => 15, :scale => 10
     t.timestamps

    end

    execute "alter table timeline_events
               add constraint fk_timeline_events_memorylanes
               foreign key  (memorylane_id) references memorylanes(id)"

  end

  def self.down
    drop_table :timeline_events
  end
end